﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CentroVentas.Forms.Compras
{
    /// <summary>
    /// Lógica de interacción para FrmListarCompras.xaml
    /// </summary>
    public partial class FrmListarCompras : Page
    {
        public FrmListarCompras(String Buscador)
        {
            InitializeComponent();

            if (Buscador != string.Empty)
                txtBuscar.Text = Buscador;
            
        }



        private void MenuDetalleCompra_Click(object sender, RoutedEventArgs e)
        {

        }

        private void ConfirmarCompra_Click(object sender, RoutedEventArgs e)
        {

        }

        private void CancelarCompra_Click(object sender, RoutedEventArgs e)
        {

        }

        private void txtBuscar_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtBuscar.Text))
                this.Grilla.DataContext = CVCore32.Class.Funciones.Compras.Compras.GetComprasList();
            else
                this.Grilla.DataContext = CVCore32.Class.Funciones.Compras.Compras.GetComprasList(txtBuscar.Text);
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            this.Grilla.DataContext = CVCore32.Class.Funciones.Compras.Compras.GetComprasList();
        }

        private void chkVisible_Checked(object sender, RoutedEventArgs e)
        {

        }

        private void chkVisible_Click(object sender, RoutedEventArgs e)
        {
            this.Grilla.DataContext = CVCore32.Class.Funciones.Compras.Compras.GetComprasList(txtBuscar.Text, !Convert.ToBoolean(chkVisible.IsChecked));
        }

        

    }
}
